layui.define(["table", "form"], function(e) {
    var admin = layui.admin;
    var $ = layui.$,
        form = layui.form,
        table = layui.table;
    //监听搜索
    form.on('submit(LAY-info-front-search)', function(data) {
        var field = data.field;
        //执行重载
       table.reload('LAY-info-manage', {
            where: field,
            page: {curr: 1},
        });
    });
    //事件
    var active = {
        batchdel: function() {},
         
    };
    $('.layui-btn.layuiadmin-btn-info').on('click', function() {
        var type = $(this).data('type');
        active[type] ? active[type].call(this) : '';
    });
    //表格内处理     
    table.render({
        elem: "#LAY-info-manage",
        url: app_url + "missionschedule/listData", 
        cols: [
            [  {
                field: "id",
                title: "ID",
                sort: !0,
                width:80,
            }, { 
                field: "username",
                title: "参与人",
                width:120,
               
                align:'center',
                templet:'#userTpl',
               
            }, {
                field: "title",
                title: "任务",
               
            } , {
                field: "content",
                title: "投稿",
                templet:function(d){
                    return htmlDecode(d.content);
                }
               
            }, {
                field: "view_able",
                title: "采纳前可见",
                templet:"<div>{{d.view_able}}%</div>",
               
            } , {
                field: "create_time",
                title: "创建时间",
               
            }, {
                field: "status_txt",
                title: "状态",
               
            }]
        ],
        page: !0,
        limit: 10,
        height: "full-80",
       
        text: "对不起，加载出现异常！"
    }), table.on("tool(LAY-info-manage)", function(e) {
         
    }), e("missionschedule", {})
});